<@cms.surveyList userId=userId startStartDate=startStartDate endStartDate=endStartDate 
            startEndDate=startEndDate endEndDate=endEndDate 
            title=title disabled=disabled 
            orderField=orderField orderType=orderType pageIndex=pageNum pageSize=numPerPage>
<div class="pageHeader card">
    <form class="pagerForm" autocomplete="off" onsubmit="return navTabSearch(this);" method="post">
        <#include "../include_page/parameters.html"/>
        <div class="searchBar">
            <ul class="searchContent">
                <li>
                    <label><@t.page 'content.promulgator'/>:</label>
                    <#include "../include_page/userId.html"/>
                </li>
                <li>
                    <label><@t.page 'start_date'/>:</label>
                    <input type="text" name="startStartDate" class="date" size="10" dateFmt="yyyy-MM-dd" value="${startStartDate!}"/>
                    <a class="inputDateButton" href="javascript:void(0);"></a>
                    <span>-</span>
                    <input type="text" name="endStartDate" class="date" size="10" dateFmt="yyyy-MM-dd" value="${endStartDate!}"/>
                    <a class="inputDateButton" href="javascript:void(0);"></a>
                </li>
                <li>
                    <label><@t.page 'end_date'/>:</label>
                    <input type="text" name="startEndDate" class="date" size="10" dateFmt="yyyy-MM-dd" value="${startEndDate!}"/>
                    <a class="inputDateButton" href="javascript:void(0);"></a>
                    <span>-</span>
                    <input type="text" name="endEndDate" class="date" size="10" dateFmt="yyyy-MM-dd" value="${endEndDate!}"/>
                    <a class="inputDateButton" href="javascript:void(0);"></a>
                </li>
                <li>
                    <label><@t.page 'title'/>:</label>
                    <input type="text" name="title" value="${title!}"/>
                </li>
                <#include "../include_page/disabled.html"/>
            </ul>
            <div class="subBar">
                <ul>
                    <li>
                        <button type="submit" class="buttonActive"><@t.page 'button.search'/></button>
                    </li>
                </ul>
            </div>
        </div>
    </form>
</div>
<@sys.authorized roleIds=admin.roles urls='cmsSurvey/add,cmsSurvey/delete,cmsSurvey/view,cmsSurveyQuestion/list,cmsUserSurvey/list'><#assign authorizedMap=map/></@sys.authorized>
<div class="card">
    <div class="panelBar">
        <ul class="toolBar">
        <#if authorizedMap['cmsSurvey/add']>
            <li><a href="cmsSurvey/add.html" target="navTab" rel="cmsSurvey/add"><i class="icon-plus-sign-alt icon-large"></i><@t.page 'button.add'/></a></li>
        </#if>
        <#if authorizedMap['cmsSurvey/delete']>
            <li><a href="cmsSurvey/delete?_csrf=<@tools.csrfToken admin=true/>" title="<@t.page 'confirm.batch_delete'/>" target="selectedTodo" rel="ids"><i class="icon-trash icon-large"></i><@t.page 'button.batch_delete'/></a></li>
        </#if>
        </ul>
    </div>
    <table class="table" width="100%" layoutH orderField="${orderField!}" orderType="${orderType!}">
        <thead>
            <tr>
                <th width="20"><input type="checkbox" group="ids" class="checkboxCtrl"></th>
                <th>ID</th>
                <th><@t.page 'survey.type'/></th>
                <th><@t.page 'title'/></th>
                <th><@t.page 'description'/></th>
                <th><@t.page 'content.promulgator'/></th>
                <th orderField="votes"><@t.page 'content.score'/></th>
                <th orderField="startDate"><@t.page 'start_date'/></th>
                <th orderField="endDate"><@t.page 'end_date'/></th>
                <th orderField="createDate"><@t.page 'create_date'/></th>
                <th class="wrap"><@t.page 'operate'/></th>
            </tr>
        </thead>
        <tbody>
            <#list page.list as a>
                <@t.merge 'userIds' a.userId!/>
            </#list>

            <@sys.user ids=t.userIds!><#assign userMap=map!/></@sys.user>

            <#list page.list as a>
            <tr>
                <td class="center"><input name="ids" value="${a.id}" type="checkbox"></td>
                <td class="center">${a.id!}</td>
                <td class="center"><@t.page 'survey.type.'+a.surveyType/></td>
                <td><a href="cmsSurvey/view.html?id=${a.id}" class="exclude-translate" target="dialog" rel="viewSurvey${a.id}">${a.title!}</a></td>
                <td class="center exclude-translate">${a.description!}</td>
                <td class="center exclude-translate">${(userMap[a.userId?string].nickname)!}</td>
                <td>${a.votes!}</td>
                <td>${a.startDate!}</td>
                <td>${a.endDate!}</td>
                <td>${a.createDate!}</td>
                <td class="wrap">
                <#if !a.disabled>
                    <#if authorizedMap['cmsSurvey/add']>
                        <a href="cmsSurvey/add.html?id=${a.id}" class="edit btnText blue" target="navTab" rel="cmsSurvey/edit"><i class="icon-edit"></i><@t.page 'button.edit'/></a>
                    </#if>
                    <#if authorizedMap['cmsSurveyQuestion/list']>
                        <a href="cmsSurveyQuestion/list.html?surveyId=${a.id}" class="edit btnText green" target="navTab" rel="cmsSurveyQuestion/list"><i class="icon-question"></i><@t.page 'question'/></a>
                    </#if>
                    <#if authorizedMap['cmsUserSurvey/list']>
                        <a href="cmsUserSurvey/list.html?surveyId=${a.id}" class="edit btnText green" target="navTab" rel="cmsUserSurvey/list"><i class="icon-umbrella"></i><@t.page 'answer'/></a>
                    </#if>
                    <#if authorizedMap['cmsSurvey/delete']>
                        <a href="cmsSurvey/delete?ids=${a.id}&_csrf=<@tools.csrfToken admin=true/>" class="btnText warn" title="<@t.page 'confirm.delete'/>" target="ajaxTodo"><i class="icon-trash"></i><@t.page 'button.delete'/></a>
                    </#if>
                </#if>
                </td>
            </tr>
            </#list>
        </tbody>
    </table>
    <#include "../include_page/page.html"/>
</div>
</@cms.surveyList>